
import axios from '../utils/axios';
import { Message } from "element-ui";
export default {
  namespaced: true,
  state: () => ({
  allDisease: [
    { "value": "高血压" },
    { "value": "高血脂"},
    { "value": "糖尿病"}
  ],
  bodyList: {
    tou: {
      name: "头部",
      item: ["颅脑", "眼", "鼻", "耳", "面部", "口", "咽喉"],
      className: "kuan1",
      state: 1,
    },
    jin: {
      name: "颈部",
      item: ["甲状腺", "气管"],
    className: "kuan1  kuan2",
      state: 1,
    },
    xuong: {
      name: "胸部",
      item: ["乳房", "肺", "心脏", "食管", "膈肌", "纵膈"],
      className: "kuan1 kuan3",
      state: 1,
    },
    fu: {
      name: "腹部",
      item: ["胃", "肠", "肝", "阑尾", "胰腺", "脾", "肝"],
      className: "kuan1 kuan4",
      state: 1,
    },
    yao: {
      name: "腰部",
      item: ["肾", "肾上腺", "输尿管"],
      className: "kuan1 kuan10",
      state: 1,
    },
    shengzhi: {
      name: "生殖器官",
      item: [
        "前列腺", "睾丸","阴茎","输精管","阴囊","卵巢","子宫", "输卵管","阴道","外阴",
      ],
      className: "kuan1 kuan5",
      state: 1,
    },
    shangzhi1: {
      name: "上肢",
      item: ["肩部", "上臂", "肘部", "前臂", "手部"],
      className: "kuan1 kuan6",
      state: 1,
    },
    shangzhi2: {
      name: "上肢",
      item: ["肩部", "上臂", "肘部", "前臂", "手部"],
      className: "kuan1 kuan7",
      state: 1,
    },
    xiazhi1: { name: "下肢", item: ["大腿", "小腿", "膝部", "足部"] ,
    className: "kuan1 kuan8",
      state: 1,},
      xiazhi2: { name: "下肢", item: ["大腿", "小腿", "膝部", "足部"] ,
    className: "kuan1 kuan9",
      state: 1,},
    fei: {
      name: "肺",
      item: ["肺结核", "肺炎", "哮喘", "支气管扩展", "小儿肺炎"],
      className: "kuan22 kuan16",
      state: 2,
    },
    xinzang: {
      name: "心脏",
      item: ["冠心病", "心肌梗塞", "心绞痛", "心肌炎", "心脏病", "窦性心动过速"],
      className: "kuan22 kuan15",
      state: 2,
    },
    wei: {
      name: "胃",
      item: ["慢性胃癌", "胃炎", "胃溃疡", "反流性食管炎", "幽门螺杆菌感染"],
      className: "kuan22 kuan14",
      state: 2,
    },
    gan: {
      name: "肝",
      item: ["乙肝", "脂肪肝", "肝硬化", "原发性肝癌", "肝囊肿", "肝癌"],
      className: "kuan22 kuan11",
      state: 2,
    },
    dan: {
      name: "胆",
      item: ["胆囊息肉", "胆囊炎", "胆囊结石", "胆管癌"],
      className: "kuan22 kuan12",
      state: 2,
    },
    lunao: {
      name: "颅脑",
      item: ["偏头痛", "脑出血", "帕金森", "老年痴呆症", "脑梗死", "脑动脉硬化"],
      className: "kuan22 kuan13",
      state:2,
    },
  },
  }),
  mutations: {
    setBody(store,data){
      store.bodyList=data
    }
  },
actions:{
  getBody(context){
    return new Promise(function(resolve, reject){
      axios({
        method: 'get',
        url: '/classify/getBodyList',
      })
        .then((res) => {
          console.log(res)
          if (res.code == 200) {
            resolve(res.data)
            context.commit('setBody',res.data)
          } else {
            Message({
              message: '哎呀网络出错了，请刷新页面试试！',
              type: 'error'
            });
          }
        })
        .catch((err) => {
          console.log(err);
        })
      })
  }
},
  getters: {
    
  }
}